use "$temp/acs_longform_merged_clean", clear
keep if dby>=1990 //restrict to at-risk sample
tab age_group parent_inc_quart

//final cleaning
replace coll = 0 if age_group == 1
replace assoc = 0 if age_group == 0
drop if parent_inc_quart == .  //nix matched kids with no parent income
replace ti = . if wag == . 
replace wag = . if ti == . 

//similar stuff with hourly wage variable
drop logwag
gen logwag = log(wag) //remake logwag
replace wag = wag/1000
replace ti = ti/1000 //rescaling
replace hrlywage = 0 if hrlywage == . & age>=16
replace hrlywage = . if wag==.

//load in graphing programs
do "$support/Programs/4_results_quart_programs"

*********plotting******
/*
//notes on syntax here:
"plotreg" is a command written by myself and defined in 4_results_quart_programs.do

The function admits 4 arguments that follow immediately after invoking it (these can be viewed in lines 5 through 9 
in 4_results_quart_programs.do):
-First argument: the dependent variable to be analyzed and plotted
-Second argument: The y-axis scale to be used for plotting the regression coefficients (e.g. "2" will result in the y-axis spanning from -2 to 2.)
-Third Argument: The y-axis scale to be used for plotting the mean of the outcome variable, IF the variable is not in log scale.
-Fourth argument: A binary argument indicating whether the dependent variable at hand is in log scale.

E.g. the first call of this command tells the "plotreg" function to run regressions for the "coll" outcome variable,
plot the regression coefficinets with a y-axis ranging from -4 to 4, plot outcome variable means with a y-axis ranging from -60 to 60,
and specifies that "coll" is not a variable measured in log scale.

Note that all these arguments are purely cosmetic and are not derived from any kind of data fundamentals.

*/

//important graphs
plotreg coll 4 60 0  //college attainment
plotreg wag 1500 40000 0 //wage income
plotreg emp 4 100 0  //employment
plotreg mig_cz 4 40 0  //migration

//educational attainment
plotreg hs 2 100 0 
plotreg somecoll 3 90 0 
plotreg assoc 4 70 0 
plotreg enroll 3 100 0 
plotreg adv 4 20 0 

//income, employment, hours, wages
plotreg ti 1500 40000 0 
plotreg hrlywage 1 20 0 
plotreg logwag .1 0 1  

////////
